<!DOCTYPE html>
<html lang="en">
	<head>
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
		<meta charset="utf-8" />
		<title>驴妈妈流立方</title>
		<meta name="description" content="overview &amp; stats" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0" />
		<!-- bootstrap & fontawesome -->
		<link rel="stylesheet" href="${rc.contextPath}/assets/css/bootstrap.min.css" />
		<link rel="stylesheet" href="${rc.contextPath}/assets/font-awesome/4.5.0/css/font-awesome.min.css" />
		<!-- page specific plugin styles -->
		<link rel="stylesheet" href="${rc.contextPath}/assets/css/daterangepicker.min.css" />
		<!-- text fonts -->
		<link rel="stylesheet" href="${rc.contextPath}/assets/css/fonts.googleapis.com.css" />
		<!-- ace styles -->
		<link rel="stylesheet" href="${rc.contextPath}/assets/css/ace.min.css" class="ace-main-stylesheet" id="main-ace-style" />
		<link rel="stylesheet" href="${rc.contextPath}/assets/css/ace-skins.min.css" />
		<link rel="stylesheet" href="${rc.contextPath}/assets/css/ace-rtl.min.css" />
		<link rel="stylesheet" href="${rc.contextPath}/assets/css/bootstrap-datetimepicker.min.css" />
		
		<link rel="stylesheet" href="${rc.contextPath}/assets/css/jquery.gritter.min.css" />
		<!-- ace settings handler -->
		<script src="${rc.contextPath}/assets/js/ace-extra.min.js"></script>
		<link rel="stylesheet" href="${rc.contextPath}/assets/css/bsie-paginator.css" />
	</head>

	<body class="skin-2" style="background-color: #FFF;">
		<div class="page-content">
			<!-- <div class="page-header">
				<h1>
					日志查询
					<small>
						<i class="ace-icon fa fa-angle-double-right"></i>
						日志列表
					</small>
				</h1>
			</div> -->
			<div class="row">
				<div class="col-xs-12">
					<div id="dynamic-table_wrapper" class="dataTables_wrapper form-inline no-footer">
						<div class="row">
							<form class="form-inline" id="searchForm" method="post" action="${rc.contextPath}/log/list">
								<div class="col-xs-2">
									<div class="dataTables_length">
										<label>用户名
											<input type="text" class="form-control" name="operator" value="${condition.operator!}" placeholder="查询用户名">
										</label>
									</div>
								</div>
								<div class="col-xs-2">
									<div class="dataTables_length">
										<label>请求地址
											<input type="text" class="form-control" name="requestUri" value="${condition.requestUri!}" placeholder="请求地址">
										</label>
									</div>
								</div>
								<div class="col-xs-2">
									<div class="dataTables_length">
										<label>开始时间
											<input type="text" class="form-control datetimepicker" name="beginDate" value="${condition.beginDate!}" placeholder="查询开始时间">
										</label>
									</div>
								</div>
								<div class="col-xs-2">
									<div class="dataTables_length">
										<label>结束时间
											<input type="text" class="form-control datetimepicker" name="endDate" value="${condition.endDate!}" placeholder="查询结束时间">
										</label>
									</div>
								</div>
								<div class="col-xs-2">
									<div class="dataTables_length">
										<button id="search" type="button" class="btn btn-pink btn-sm">
											<span class="ace-icon fa fa-search icon-on-right bigger-110"></span>
											查询
										</button>
									</div>
								</div>
							</form>
						</div>
						<table id="dynamic-table" class="table table-striped table-bordered table-hover dataTable no-footer" role="grid" aria-describedby="dynamic-table_info">
							<thead>
								<tr>
									<th>No.</th>
									<th>用户名</th>
									<th>IP地址</th>
									<th>请求地址</th>
									<th>请求参数</th>
									<th>创建时间</th>
								</tr>
							</thead>
							<tbody>
								<#if logs?? && logs?size&gt;0>
									<#list logs as log>
										<tr class="">
											<td>${log_index + 1}</td>
											<td>${log.operator!}</td>
											<td>${log.remoteAddr!}</td>
											<td>${log.requestUri!}</td>
											<#if log.params?? && log.params?length&gt;50>
											<td title="${log.params!}">${log.params[0..50]!}...</td>
											<#else>
											<td>${log.params!}</td>
											</#if>
											<td>${log.createDate?string('yyyy-MM-dd HH:mm:ss')}</td>
										</tr>
									</#list>
								<#else>
									<tr>
										<td colspan="12">
											<div class="alert alert-danger" style="margin-bottom: 0px;" role="alert">没有记录!</div>
										</td>
									</tr>
								</#if>
							</tbody>
						</table>
						<#include "paginator.html">
					</div>
				</div>
			</div>		
		</div>
		<script src="${rc.contextPath}/assets/js/jquery-2.1.4.min.js"></script>
		<script type="text/javascript">
			if('ontouchstart' in document.documentElement) document.write("<script src='${rc.contextPath}/assets/js/jquery.mobile.custom.min.js'>"+"<"+"/script>");
		</script>
		<script src="${rc.contextPath}/assets/js/bootstrap.min.js"></script>

		<!-- page specific plugin scripts -->
		<script src="${rc.contextPath}/assets/js/jquery-ui.min.js"></script>
		<script src="${rc.contextPath}/assets/js/jquery.ui.touch-punch.min.js"></script>

		<!-- ace scripts -->
		<script src="${rc.contextPath}/assets/js/ace-elements.min.js"></script>
		<script src="${rc.contextPath}/assets/js/ace.min.js"></script>
		<!-- user scripts -->
		<script src="${rc.contextPath}/assets/js/user/base.js"></script>
		<script src="${rc.contextPath}/assets/js/moment.min.js"></script>
		<script src="${rc.contextPath}/assets/js/bootstrap-datetimepicker.min.js"></script>
		
		<script type="text/javascript">
			jQuery(function($) {
				var message = "${message}";
				if(!isEmpty(message)) {
					showMsg(message);
				}
				
				var options = {
						format:'YYYY-MM-DD HH:mm:ss'
				}
				$('.datetimepicker').datetimepicker(options).next().on(ace.click_event, function(){
					$(this).prev().focus();
				});
				
				$("#search").on("click",function(){
					$(this).attr("disabled","true");
					$(this).attr("readOnly","true");
					$("#searchForm").submit();
				});
			})
		</script>
	</body>
</html>